package com.etcxy.beanslife;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

public class PersonService implements BeanNameAware, BeanFactoryAware,
		ApplicationContextAware, InitializingBean {

	private String name;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void sayHi() {
		System.out.println("hello  " + name);
	}

	public void setBeanName(String arg0) {

		System.out.println("setBeanName被调用" + arg0);
	}

	public void afterPropertiesSet() throws Exception {

		System.out.println("afterPropertiesSet" + "方法被调用");
	}

	public void setApplicationContext(ApplicationContext arg0)
			throws BeansException {
		System.out.println("setApplicationContext" + "方法被调用");
	}

	public void setBeanFactory(BeanFactory arg0) throws BeansException {
		System.out.println("setBeanFactory" + "方法被调用");
	}
	
	public void myinit(){
		System.out.println("我的定制初始化方法");
	}
}
